<mat-card class="form-card">
  <div class="mat-content">
    <form (ngSubmit)="onSubmit($event)" *ngIf="formGroup" [formGroup]="formGroup" class="form-wrap" #entityForm="ngForm">
      <div class="fieldset-container fieldset-display-default" *ngIf="fieldSets">
        <ng-container *ngFor="let fieldSet of fieldSets.list(); let i = index">
          <div [ngClass]="fieldSet.class" [style.margin-bottom.px]="12" class="fieldset divider-{{fieldSet.divider}}" fxLayout="row wrap" fxLayoutAlign="start start" fxFlex="100%" fxFlex.gt-xs="calc({{fieldSet.width}} - 16px)">
            <mat-divider *ngIf="fieldSet.divider && i > 0"></mat-divider>
            <h4 *ngIf="fieldSet.label" class="fieldset-label">{{fieldSet.name}}</h4>
            <div *ngFor="let field of fieldSet.config; let ii = index" fxFlex="100%" fxFlex.gt-xs="calc({{field.width}} - 16px)" [ngClass]="field.class == 'inline' ? 'form-inline' : 'form-line'" id="{{fieldSet.name}}-{{ii}}">
              <div id="form_field_{{field.name}}" dynamicField [config]="field" [group]="formGroup" [fieldShow]="show"></div>
            </div>
          </div>
        </ng-container>
        <mat-card-actions class="buttons">
          <button id="save_button" class="btn btn-block btn-warning" type="submit" mat-button color="primary" [disabled]="!entityForm.form.valid">{{ "Save" | translate}}</button>
        </mat-card-actions>
      </div>
    </form>
  </div>
</mat-card>
